//备注：拷贝代码请加上作者信息
//作者：王海涛
//邮箱：1126471088@qq.com
//版本：V1.0.0
/********************************************************
    说明：
    1、IO控制响应时间小于5毫秒。
    2、可以控制灯/继电器等。
    3、支持拉高/拉低,支持周期拉高拉低,支持SOS求援。
**********************************************************/
#ifndef __APP_IO_CTRL_H__
#define __APP_IO_CTRL_H__

#include "FreeRTOS.h"
#include "task.h"
#include "../../Driver/io_ctrl/io_ctrl_driver.h"


#define IO_Ctrl_Task_Update_Rate   (5 / portTICK_RATE_MS)//任务更新率 portTICK_RATE_MS ~ portMAX_DELAY

/* 此函数由底层驱动提供 */
extern void WHT_IO_Ctrl_Set_Value(WHT_IO_Ctrl_enum number, WHT_IO_Ctrl_State_enum state);

typedef struct
{
    void (*WHT_Install)(unsigned char task_priority); //安装任务
    void (*WHT_Uninstall)(void);                      //卸载任务
    void (*WHT_Set_State)(WHT_IO_Ctrl_enum name, WHT_IO_Ctrl_State_enum state);//常规控制
    void (*WHT_Set_Flash)(WHT_IO_Ctrl_enum name, unsigned short flash_count, unsigned short on_time, unsigned short off_time, WHT_IO_Ctrl_State_enum end_state);//闪烁控制
    void (*WHT_Start_SOS)(WHT_IO_Ctrl_enum name);     //开启SOS
    void (*WHT_End_SOS)(WHT_IO_Ctrl_enum name);       //结束SOS
}WHT_IO_Ctrl_t;

extern const WHT_IO_Ctrl_t WHT_IO_Ctrl;//控制句柄


#endif
